package Demo1;

class Student extends Person {
    public Student(String name, int age) {
        super(name, age);
    }

    public static void main(String[] args) {
        Student student = new Student("zhangsan", 18);
        System.out.println(student);

    }

}

public class Person {
    private String name;
    int age = 10;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
